<div class="content-wrapper" [@routerTransition]>
    <sub-header [kind]="kind">
        <div role="actions">
            <button (click)="create()" class="btn" [ngClass]="{'blue':canCreateNew,'btn-default':!canCreateNew}" [disabled]="!canCreateNew">
                <i class="fa fa-plus"></i>起草
            </button>
        </div>
    </sub-header>
    <section class="content d-flex flex-column flex-column-fluid">
        <div [class]="containerClass">
            <div class="card card-custom gutter-b">
                <div class="card-body">
                    <form class="form" autocomplete="new-password">
                        <div>
                            <div class="row align-items-center mb-4">
                                <div class="col-xl-12">
                                    <div class="form-group m-form__group align-items-center">
                                        <div class="input-group">
                                            <input [(ngModel)]="filterText" name="filterText" autoFocus
                                                class="form-control m-input" [placeholder]="l('SearchWithThreeDot')"
                                                type="text">
                                            <div class="input-group-append">
                                                <button (click)="getListData()" class="btn btn-default" type="submit"><i
                                                        class="icon-magnifier"
                                                        [attr.aria-label]="l('Search')"></i></button>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="row mb-4" style="display: none;">
                                <div class="col-sm-12">
                                    <span class="clickable-item text-muted" *ngIf="!advancedFiltersAreShown"
                                        (click)="advancedFiltersAreShown=!advancedFiltersAreShown"><i
                                            class="fa fa-angle-down"></i> {{"ShowAdvancedFilters" | localize}}</span>
                                    <span class="clickable-item text-muted" *ngIf="advancedFiltersAreShown"
                                        (click)="advancedFiltersAreShown=!advancedFiltersAreShown"><i
                                            class="fa fa-angle-up"></i> {{"HideAdvancedFilters" | localize}}</span>
                                </div>
                            </div>
                        </div>
                    </form>
                    
                    <div class="row">
                         <tabset class="ui-tabs-nav">
                             <tab  (selectTab)="onTabSelect($event,i)" heading="{{item.name}}" [active]="pagedPaperParam.wfQueryType === item.type"  *ngFor="let item of actionNames,let i = index">
                            </tab>
                         </tabset>
                    </div>

                    <div class="row align-items-center">
                        <!--<Primeng-TurboTable-Start>-->
                        <div class="primeng-datatable-container" [busyIf]="primengTableHelper.isLoading">
                            <p-table #dataTable sortMode="multiple" (onLazyLoad)="getListData($event)"
                                [value]="primengTableHelper.records"
                                rows="{{primengTableHelper.defaultRecordsCountPerPage}}" [paginator]="false"
                                [lazy]="true" [scrollable]="true" ScrollWidth="100%"
                                [responsive]="primengTableHelper.isResponsive"
                                [resizableColumns]="primengTableHelper.resizableColumns">
                                <ng-template pTemplate="header">
                                    <tr>
                                        <th style="width: 120px">
                                            {{'Title'| localize}}
                                        </th>
                                        <th style="width: 80px">
                                            环节
                                        </th>
                                        <th style="width: 80px">
                                            审核状态
                                        </th>
                                        <th style="width: 120px">
                                            {{'CreationTime' | localize}}
                                        </th>
                                        <th style="width: 80px">
                                            {{'Actions' | localize}}</th>
                                    </tr>
                                </ng-template>
                                <ng-template pTemplate="body" let-record="$implicit">
                                    <tr>
                                     
                                        <td style="width: 120px">
                                            <span class="p-column-title"> {{'Title'| localize}}</span>
                                            <a (click)="goDetailModel(record.paperId)" href="javascript:void(0)">
                                                {{record.title}}
                                            </a>
                                        </td>
                                        <td style="width: 80px">
                                            <span class="p-column-title">环节</span>
                                            {{record.nodeName}}
                                        </td>
                                        <td style="width: 80px">
                                            <span class="p-column-title">审核状态</span>
                                            {{record.shenHe}}
                                        </td>
                                        <td style="width: 120px">
                                            <span class="p-column-title"> {{'CreationTime' | localize}}</span>
                                            {{record.startTime | luxonFormat:'yyyy-MM-dd HH:mm:ss'}}
                                        </td>
                                        <td style="width: 80px">
                                            <a class="edit mr-2" href="javascript:void(0)" (click)="goDetailModel(record.paperId)">{{"LookOver" | localize}}</a>
                                            <a class="recall" href="javascript:void(0)" *ngIf="pagedPaperParam.wfQueryType === 0" (click)="deleteWorkFlow(record.paperId)">{{"Delete" | localize}}</a>
                                        </td>
                                    </tr>
                                </ng-template>
                            </p-table>
                            <div class="primeng-no-data" *ngIf="primengTableHelper.totalRecordsCount == 0">
                                {{'NoData' | localize}}
                            </div>
                            <div class="primeng-paging-container">
                                <p-paginator [rows]="primengTableHelper.defaultRecordsCountPerPage" #paginator
                                    (onPageChange)="getListData($event)"
                                    [totalRecords]="primengTableHelper.totalRecordsCount"
                                    [rowsPerPageOptions]="primengTableHelper.predefinedRecordsCountPerPage"
                                    [showCurrentPageReport]="true"
                                    [currentPageReportTemplate]="'TotalRecordsCount' | localize:primengTableHelper.totalRecordsCount">
                                </p-paginator>
                            </div>
                        </div>
                        <!--<Primeng-TurboTable-End>-->
                    </div>
                </div>
            </div>
        </div>

        <workFlowDetail #workFlowDetail (backListEvent)="backToList($event)"></workFlowDetail>
    </section>
</div>
